<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>角色列表</title>
    <link rel="stylesheet" href="/gzht/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/gzht/lib/layui/formselects/formSelects-v4.css">
    <link rel="stylesheet" href="/gzht/lib/Hui-iconfont/1.0.8/iconfont.min.css" media="all">
</head>
<body>
<%--表格--%>
<table id="roleList" lay-filter="roleListTable"></table>
<%--表头工具--%>
<script type="text/html" id="tools">
    <button type="button" class="layui-btn layui-btn-sm" lay-event="h_role_add">
        <i class="layui-icon">&#xe608;</i> 添加
    </button>
    <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="h_role_del">
        <i class="layui-icon">&#xe640;</i> 删除
    </button>
</script>
<%--行内工具条--%>
<script type="text/html" id="col_tool">
    <div class="layui-btn-group">
        <button type="button" class="layui-btn layui-btn-sm" lay-event="edit">
            <i class="layui-icon">&#xe642;</i>
        </button>
        <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">
            <i class="layui-icon">&#xe640;</i>
        </button>
    </div>
</script>

<%--添加角色表单--%>
<div id="addRoleArea" style="display: none;padding: 0.5rem;">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-block">
                <input type="text" name="roleName" required  lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">分配权限</label>
                <div class="layui-input-inline" style="width: 360px;">
                    <select name="roleLimit" id="roleLimit" lay-filter="roleLimit"
                            xm-select="roleLimit" xm-select-type="1">
                        <option value=""></option>
                        <c:forEach items="${limits}" var="limit">
                            <c:choose>
                                <c:when test="${limit.limitStatus == 0}">
                                    <option value="${limit.limitNo}">${limit.limitName}</option>
                                </c:when>
                                <c:when test="${limit.limitStatus == 1}">
                                    <option value="${limit.limitNo}" disabled>${limit.limitName}</option>
                                </c:when>
                            </c:choose>
                        </c:forEach>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="roleStatus" value="0" lay-skin="switch" lay-text="启用|禁用" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="roleRemark" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="roleAddSubmit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

</div>
<script src="/gzht/statics/js/jquery-1.12.2.min.js"></script>
<script src="/gzht/lib/layui/layui.js"></script>
<script src="/gzht/lib/layui/formselects/formSelects-v4.js"></script>
<script src="/gzht/statics/utils/TreeUtil.js"></script>
<script src="/gzht/statics/js/roleList/roleList.js"></script>
</body>
</html>
